package batframework.mvc.web;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import batframework.mvc.Session;


public class WebContext
{
	private HttpServletRequest request;
	
	private HttpServletResponse response;
	
	private ServletContext servletContext;
	
	private String requestPath;
	
	private String requestMethod;
	
	private Session session;

	public WebContext(HttpServletRequest request, HttpServletResponse response)
	{
		this.request = request;
		this.response = response;
		this.servletContext = request.getServletContext();
		this.requestPath = request.getServletPath();
		this.setRequestMethod(request.getMethod());
	}

	public HttpServletRequest getRequest()
	{
		return request;
	}

	public void setRequest(HttpServletRequest request)
	{
		this.request = request;
	}

	public HttpServletResponse getResponse()
	{
		return response;
	}

	public void setResponse(HttpServletResponse response)
	{
		this.response = response;
	}

	public ServletContext getServletContext()
	{
		return servletContext;
	}

	public void setServletContext(ServletContext servletContext)
	{
		this.servletContext = servletContext;
	}

	public String getRequestPath()
	{
		return requestPath;
	}

	public void setRequestPath(String requestPath)
	{
		this.requestPath = requestPath;
	}

	public String getRequestMethod()
	{
		return requestMethod;
	}

	public void setRequestMethod(String requestMethod)
	{
		this.requestMethod = requestMethod;
	}

	public Session getSession()
	{
		return session;
	}

	public void setSession(Session session)
	{
		this.session = session;
	}	
}
